package com.datasource.datasourceslink.dao.test1;

import com.datasource.datasourceslink.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface TestDao1 {
    @Select("select * from user")
    List<Map<String,Object>> selectAll();

    List<User> selectUser();

    @Select("select count(*) from user where id = #{id}")
    Integer selectOne(Integer id);

    @Delete("delete from user where id = #{id}")
    void delete(Integer id);

    @Insert("INSERT into user VALUES(#{id},#{username},#{password})")
    void addOne(Map<String,Object> user);
}
